package token;

import java.text.ParseException;

public class TokenThread extends Thread {
    private int tokenBeginOrStop = 1;
    private int user_id;

    public int getUser_id() {
        return user_id;
    }

    public void setUser_id(int user_id) {
        this.user_id = user_id;
    }

    public void setThreadName(String threadName) {
        this.threadName = threadName;
    }

    private boolean exit = true;
    private String threadName;
    private String token;

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getThreadName() {
        return currentThread().getName();
    }

    public boolean isExit() {
        return exit;
    }

    public void setExit(boolean exit) {
        this.exit = exit;
    }


    public TokenThread() {

    }


    public TokenThread(String name) {
        super(name);
    }

    @Override
    public void run() {

        TokenTimer tt = new TokenTimer();
        System.out.println("该用户的计时器开始进行");
        try {
            tt.useTimer(this.getUser_id());
        } catch (ParseException e) {
            e.printStackTrace();
        }

    }

    public int getTokenBeginOrStop() {
        return tokenBeginOrStop;
    }

    public void setTokenBeginOrStop(int tokenBeginOrStops) {
        tokenBeginOrStop = tokenBeginOrStops;
    }

    public void tokenTimerBegin() {

    }
}
